package com.lzl.producer.listener;

import com.lzl.producer.Producer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class SpringBootApplicationRunner implements ApplicationRunner {

    @Autowired
    Producer producer;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        log.info("ApplicationRunner System Time is {}",System.currentTimeMillis());
        producer.start();
    }
}